{{- if (hasKey .Values.certManager "digitalOceanCredentials") }}
---
apiVersion: v1
kind: Secret
metadata:
  name: digitalocean
  namespace: d8-cert-manager
  {{- include "helm_lib_module_labels" (list . (dict "app" "cert-manager")) | nindent 2 }}
data:
  {{- if and (hasKey .Values.certManager "digitalOceanCredentials") (.Values.certManager.digitalOceanCredentials) }}
  access-token: {{ .Values.certManager.digitalOceanCredentials | b64enc | quote }}
  {{- else }}
    {{ cat "No key digitalOceanCredentials in deckhouse configmap" .Values.certManager.digitalOceanCredentials | fail }}
  {{- end }}
{{- end }}
